package com.milling.business.service.impl;

import java.util.List;
import com.milling.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.milling.business.mapper.WmsBoxInfoMapper;
import com.milling.business.domain.WmsBoxInfo;
import com.milling.business.service.IWmsBoxInfoService;

/**
 * 盒子信息Service业务层处理
 *
 * @author X
 * @date 2025-02-15
 */
@Service
public class WmsBoxInfoServiceImpl implements IWmsBoxInfoService
{
    @Autowired
    private WmsBoxInfoMapper wmsBoxInfoMapper;

    /**
     * 查询盒子信息
     *
     * @param id 盒子信息主键
     * @return 盒子信息
     */
    @Override
    public WmsBoxInfo selectWmsBoxInfoById(Long id)
    {
        return wmsBoxInfoMapper.selectWmsBoxInfoById(id);
    }

    /**
     * 查询盒子信息列表
     *
     * @param wmsBoxInfo 盒子信息
     * @return 盒子信息
     */
    @Override
    public List<WmsBoxInfo> selectWmsBoxInfoList(WmsBoxInfo wmsBoxInfo)
    {
        return wmsBoxInfoMapper.selectWmsBoxInfoList(wmsBoxInfo);
    }

    /**
     * 新增盒子信息
     *
     * @param wmsBoxInfo 盒子信息
     * @return 结果
     */
    @Override
    public int insertWmsBoxInfo(WmsBoxInfo wmsBoxInfo)
    {
        wmsBoxInfo.setCreateTime(DateUtils.getNowDate());
        return wmsBoxInfoMapper.insertWmsBoxInfo(wmsBoxInfo);
    }

    /**
     * 修改盒子信息
     *
     * @param wmsBoxInfo 盒子信息
     * @return 结果
     */
    @Override
    public int updateWmsBoxInfo(WmsBoxInfo wmsBoxInfo)
    {
        wmsBoxInfo.setUpdateTime(DateUtils.getNowDate());
        return wmsBoxInfoMapper.updateWmsBoxInfo(wmsBoxInfo);
    }

    /**
     * 批量删除盒子信息
     *
     * @param ids 需要删除的盒子信息主键
     * @return 结果
     */
    @Override
    public int deleteWmsBoxInfoByIds(Long[] ids)
    {
        return wmsBoxInfoMapper.deleteWmsBoxInfoByIds(ids);
    }

    /**
     * 删除盒子信息信息
     *
     * @param id 盒子信息主键
     * @return 结果
     */
    @Override
    public int deleteWmsBoxInfoById(Long id)
    {
        return wmsBoxInfoMapper.deleteWmsBoxInfoById(id);
    }
}
